if [ $# -ne 2 ]; then
    echo "错误：请传入2个参数（格式：./test10_3.sh 学生姓名 考分）"
    exit 1
fi
if ! [[ $2 =~ ^[0-9]+$ ]]; then
    echo "错误：考分必须是正整数"
    exit 1
fi
if [ $2 -lt 0 ] || [ $2 -gt 100 ]; then
    echo "错误：考分需在0-100之间"
    exit 1
fi
name=$1
score=$2
if [ $score -ge 90 ] && [ $score -le 100 ]; then
    comment="优秀"
elif [ $score -ge 80 ] && [ $score -le 89 ]; then
    comment="良好"
elif [ $score -ge 60 ] && [ $score -le 79 ]; then
    comment="及格"
else
    comment="不及格"
fi
echo "学生${name}的考分是${score}，评语：${comment}"


